home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / allmac21.arc / TOGGLE11.ARC / TOGGLE11.QM < prev   
Text File  |  1990-08-27  |  8KB  |  203 lines

  1. *                 Toggle Insert and AutoIndent Macros, v1.1
  2. *                               Toggle11.QM
  3. *
  4. * Description:
  5. *
  6. *      Macro Toggle            Bytes   Keeps cursor position ?
  7. *       @0 - AutoIndent  On  TH  46    No, begline
  8. *       @9 - Insert      On  TH  16    No, moves right
  9. *       @8 - Insert      On  KW  26    No, moves right
  10. *       @7 - Insert      On  TF  21    Yes
  11. *       @6 - Insert      Off TF  21    Yes
  12.  
  13. *                            Authors........
  14. *                            TH-Tom Hoghsead
  15. *                            KW-Kyle Watkins
  16. *                            TF-Tim Farley
  17. * Version History:
  18. *       1.0     Initial version, Alt9 & 0
  19. *       1.1     Alt_6,7 & 8 added
  20.  
  21.  
  22. *┌────────────────────────────────────┐
  23. *│  @0 Toggle AutoIndent ON if OFF    │
  24. *└────────────────────────────────────┘
  25. * Alt_0 is a macro to toggle AutoIndent ON if OFF. I don't have any use
  26. * for it but maybe somebody does - I leave AutoIndent ON all the time.
  27. * Alt_9, a macro to toggle Insert ON if OFF, prompted me to see if
  28. * AutoIndent could also be toggled ON if OFF. No effort was spent
  29. * optimizing Alt_0. Somebody may want to try that. If anybody can use
  30. * it, use and enjoy. There no tricks here, just taking advantage of
  31. * jtrue. By the way, AutoIndent can be toggled OFF if ON by replacing
  32. * jtrue with jfalse. Don't run with cursor line in macro below or the
  33. * ■'s in the comments will be found and things get messed up.
  34. *
  35. @0 macrobegin
  36.         setrmargin "3" return           * set line 3 chars
  37.         insertline                      * insertblank line for bot para
  38.         begline                         * go to begin of line
  39.         cursorright                     * insert space
  40.         insertline                      * insert 2nd blank line
  41.         #254                            * insert ■ on line in column 2
  42.         insertline                      * insert 3rd blank line
  43.         begline                         * go to begin of line
  44.         #254 #254                       * insert ■■ in column 1 & 2
  45.         insertline                      * insert blank line for top para
  46.         wrappara                        * format paragraph
  47.         setrmargin  "80" return         * reset right margin
  48.         cursorup                        * get cursor line on bot para
  49.         begline                         * go to begline
  50.         find #254 return return         * try to find ■
  51.  jtrue INDENTON:                        * if ■ in column 1, can't find
  52.         toggleindent                    * toggle AutoIndent ON
  53.  INDENTON:                              * begin clean up
  54.         delline                         * delete line ■
  55.         cursorup                        * cursor up to line ■■
  56.         delline                         * delete       line ■■
  57.         cursorup                        * cursor up to blank line
  58.         delline                         * delete blank line
  59.         delline                         * delete blank line
  60.         scrollup                        * reallign screen
  61. *
  62. * 46 bytes Sat  07-28-1990  18:33:31
  63.  
  64. * 1  
  65. * 2
  66. * 3  try Alt_0 here not above
  67. * 4
  68. * 5
  69. * 6
  70.  
  71.  
  72.  
  73. *┌───────────────────────────────┐
  74. *│ @9 toggles Insert ON if OFF   │
  75. *└───────────────────────────────┘
  76. *
  77. @9 macrobegin
  78.         insertline                     * insert test line
  79.         "a" cursorleft "a"             * insert "aa"
  80.         endline                        * if not at endline-insert is on
  81.  jtrue END:                            * if at endline    -insert is off
  82.         toggleinsert                   * toggle on if off
  83.  END:                                  *
  84.         delline                        * delete test line
  85. *
  86. * 16 bytes Fri  07-27-1990  22:44:42
  87.  
  88.  
  89.  
  90. *┌────────────────────────────────┐
  91. *│ @8 Toggle Insert ON if OFF     │
  92. *└────────────────────────────────┘
  93. * Here's an alternate but slightly longer version written by Kyle
  94. * Watkins of SemWare
  95. *
  96. @8 Macrobegin
  97.         Insertline
  98.         "x"
  99.  TESTINSERT:
  100.         Insertline
  101.         Cursorleft "a" Cursorleft "a"
  102.  Endline
  103.  Jtrue END:
  104.         Toggleinsert
  105.  END:
  106.         Delline
  107.         Endline
  108.         Delline
  109. *
  110. * 26 bytes Fri  07-27-1990  22:44:48
  111.  
  112. *       Replace jtrue in Alt_9 line 3 and Alt_8 line 8 with jfalse
  113. *       to toggle off.
  114.  
  115. * To: TOM HOGSHEAD                  Refer#: 9159
  116. * From: KYLE WATKINS                    Read: 07-30-90 (18:35)
  117. * Subj: POSSIBLE QEDIT CHANGES        Status: PUBLIC MESSAGE
  118. * Conf: MAIN BOARD (0)             Read Type: GENERAL (A)
  119. *
  120. * Hi Tom,
  121. *    The macro has some steps in it which seem unneccesary -- but it takes
  122. * care of the case of being in column 1  or  column 512  AND it will
  123. * preserve the original cursor location (since it is taking care of all
  124. * possibilities, it does get involved -- but in most cases, as in yours,
  125. * It can be cut back a few bytes.)
  126. *   Also -- many thanks for the assorted macros you have written -- many
  127. * users will find them very useful.
  128. *                              --... ...--
  129. * .......Kyle Watkins (SemWare Technical Support)
  130. *
  131. * (H)elp, End of Message Command?
  132. *
  133. * Date: 07-30-90 (17:34)              Number: 9191 / 9206
  134. *   To: TOM HOGSHEAD                  Refer#: 9159
  135. * From: TIM FARLEY                      Read: NO
  136. * Subj: POSSIBLE QEDIT CHANGES        Status: PUBLIC MESSAGE
  137. * Conf: MAIN BOARD (0)             Read Type: GENERAL (A)
  138. *
  139. * TH>@0 macrobegin
  140. * TH>        insertline           * insert test line
  141. * TH>        "a" cursorleft "a"   *
  142. * TH>        endline              * if not at endline-insert is on
  143. * TH> jtrue END:                  * if at endline    -insert is off
  144. * TH>        toggleinsert         * toggle on if off
  145. * TH> END:                        *
  146. * TH>        delline              * delete test line
  147. *
  148. * Neat macro, Tom!  However, it does have a slight side effect of
  149. * moving the current cursor position to the right.  Here are
  150. * versions that make sure to undo that:
  151.  
  152. *
  153. * SET INSERT ON
  154. *
  155. @7 macrobegin
  156.         insertline           * insert test line
  157.         "a" cursorleft "a"   *
  158.         endline              * if not at endline-insert is on
  159.  jtrue WASON:                * if at endline    -insert is off
  160.         toggleinsert         * toggle on it on
  161.         Jump WASOFF:         * and exit.
  162.  WASON:
  163.         cursorleft           * clean up cursor movement
  164.  WASOFF:
  165.         cursorleft           * clean up cursor movement
  166.         delline              * delete test line
  167. *
  168. * 21 bytes Mon  07-30-1990  19:15:36
  169.  
  170. *
  171. * SET INSERT OFF
  172. *
  173. @6 macrobegin
  174.         insertline           * insert test line
  175.         "a" cursorleft "a"   *
  176.         endline              * if not at endline-insert is on
  177.  jtrue WASON:                * if at endline    -insert is off
  178.         Jump WASOFF:
  179.  WASON:
  180.         toggleinsert         * toggle it off
  181.         cursorleft           * clean up cursor movement
  182.  WASOFF:
  183.         cursorleft           * clean up cursor movement
  184.         delline              * delete test line
  185. *
  186. * 21 bytes Mon  07-30-1990  19:16:01
  187.  
  188. * --Tim Farley
  189. *   Subject (Enter)=no change?
  190. *   Message Security (H)=help?
  191. * *
  192. *     Enter your text. (Enter) alone to end. (72 chars/line, 75 lines maximum)
  193. *    (------------------------------------------------------------------------)
  194. *  1: Tim,
  195. *  2: Thanks for the suggested improvements. I'll study off line.
  196. *  3: ..Tom
  197. *  4:
  198. *
  199. *
  200. * Saving Message # 9207.
  201. *
  202. *...Tom Hogshead  Mon  07-30-1990  19:52:13
  203.